<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>给字符串标上序号</title>
</head>
<body>
<script>
    let str = 'ABBAC'   //A1 B1 B2 A2 C1'
</script>
</body>
</html>